<?php
//		文章
		$arcModel = new \Common\Model\Arc;
		
//		分类列表
		$cateModel = new \Common\Model\Cate;
		$cateData = $cateModel->get();
//		分类有多少文章
		foreach ($cateData as $key => $value) {
			$cateData[$key]['tag']=$arcModel
									->where("category_cid={$value['cid']}")
									->count();
		}		
//		p($cateData);
		

//		标签云
		$tagModel = new \Common\Model\Tag;
		$arcTagModel = new \Common\Model\ArcTag;
//		获取全部标签
		$tagData = $tagModel->get();
//		获取标签数量
		$tagData = $tagModel->get();
		foreach ($tagData as $key => $value) {
			$tagData[$key]['num']=$arcTagModel
									->join('article','aid','=','article_aid')
									->where("tag_tid={$value['tid']}")
									->count();
			
		}
		
?>
<aside class="col-md-4 hidden-sm hidden-xs">
						<div class="_widget">
							<h4>关于自己</h4>
							<div class="_info">
								<p>多年一线开发经验与讲师经验。擅长引导思维，而不是一味灌输，新生代优秀青年讲师的代表...</p>
								<p>
									<i class="glyphicon glyphicon-volume-down"></i>
									目前就职于
									<a href="http://www.houdunwang.com" target="_blank">北京后盾网</a>
								</p>
							</div>
						</div>
						<div class="_widget">
							<h4>分类列表</h4>
							<div>
								<?php foreach ($cateData as $v){?>
								<a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>"><?php echo $v['cname']?> (<?php echo $v['tag']?>)</a>
								<?php }?>
							</div>
						</div>
						<div class="_widget">
							<h4>标签云</h4>
							<div class="_tag">
								<?php foreach ($tagData as $v){?>
									<a href="c_<?php echo $v['tid']?>.html"><?php echo $v['tname']?>(<?php echo $v['num']?>)</a>
								<?php }?>
							</div>
						</div>
						
					</aside>